package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xiaotutu
 * Date: 2023-11-13
 * Time: 13:36
 */

interface IShape {
    void draw();
   /* {

    }

    public IShape() {

    }*/

}
class Cycle implements IShape {
    @Override
    public void draw() {
        System.out.println("🟢");
    }

    /*@Override
    public void draw4() {
        System.out.println("我觉得父接口的这个默认方法不好，我自己重写！");
    }*/
}
class Rect implements IShape {

    @Override
    public void draw() {
        System.out.println("🖼️");
    }
}

public class Test {
    public static void drawMap(IShape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        IShape iShape = new Cycle();
        IShape iShape1 = new Rect();
        drawMap(iShape);
        drawMap(iShape1);
    }

}
